Skip to content

Add board vid and pid in board list json output #1076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2020

Conversation

silvanocerza
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce?

New information in an existing command output.

  • What is the current behavior?

Boards vid and pid are not shown in board list --format json and are not included in the gRPC interface response.

  • What is the new behavior?

board list --format json shows connected boards vid and pid, this also works when using the --watch flag.
This information is also included in the gRPC interface response.

Example output:

[
  {
    "address": "/dev/ttyACM0",
    "protocol": "serial",
    "protocol_label": "Serial Port (USB)"
  },
  {
    "address": "/dev/ttyACM1",
    "protocol": "serial",
    "protocol_label": "Serial Port (USB)",
    "boards": [
      {
        "name": "Arduino Uno",
        "FQBN": "arduino:avr:uno",
        "VID": "0x2341",
        "PID": "0x0043"
      }
    ]
  }
]% 
  • Does this PR introduce a breaking change?

No.

  • Other information:

Fixes #1069.


See how to contribute

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks Silvano!

@silvanocerza silvanocerza merged commit dcab980 into master Nov 16, 2020
@silvanocerza silvanocerza deleted the scerza/vid-pid-board-list branch November 16, 2020 15:31
@obra
Copy link
Contributor

obra commented Nov 16, 2020

Thank you so much @silvanocerza!

@@ -118,6 +120,8 @@ func identify(pm *packagemanager.PackageManager, port *commands.BoardPort) ([]*r
boards = append(boards, &rpc.BoardListItem{
Name: board.Name(),
FQBN: board.FQBN(),
VID: port.IdentificationPrefs.Get("vid"),
PID: port.IdentificationPrefs.Get("pid"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why just VID & PID, and not the whole identificationPrefs?
In this case we have only vid/pid but the pluggable discovery can provide much more information.

@instanceofMA
Copy link

instanceofMA commented Dec 26, 2021

Hey, this PR mentions that the arduino-cli board list --format json command returns VID and PID with the --watch flag as well, but I can't make it to return VID and PID. Is there some other flag for it? Here's how it works for me:

Screen.Recording.2021-12-26.at.7.06.36.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Can board list report the vid/pid found in the json output?
5 participants